const compressionPlugin = require("compression-webpack-plugin");
module.exports = {
  devServer: {
    port: 8082,
  },
  configureWebpack: (config) => {
    // if (process.env.NODE_ENV == 'production') {
    return {
      plugins: [
        new compressionPlugin({
          //zip压缩插件
          test: /\.js$|\.html$|\.css/,
          threshold: 10240,
          deleteOriginalAssets: false,
        }),
      ],
      externals: {
        //排除一些引入的模块，不进行打包
        vue: "Vue",
        vuex: "Vuex",
        "vue-router": "VueRouter",
        axios: "axios",
        "element-ui": "ELEMENT",
        echarts: "echarts",
      },
    };
    // }
  },
};
